Passed
Pull Request — master (#45)
by
unknown
06:19
created

dropdown.js ➔ _objectSpread   B

Complexity

Conditions 6

Size

Total Lines 18
Code Lines 10

Duplication

Lines 18
Ratio 100 %

Importance

Changes 0
Metric Value
cc 6
eloc 10
c 0
b 0
f 0
dl 18
loc 18
rs 8.6666
1
/*!
2
  * Bootstrap dropdown.js v4.5.3 (https://getbootstrap.com/)
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
  */
6
(function (global, factory) {
7
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery'), require('popper.js'), require('./util.js')) :
8
  typeof define === 'function' && define.amd ? define(['jquery', 'popper.js', './util.js'], factory) :
0 ignored issues
show
Bug introduced by
The variable define seems to be never declared. If this is a global, consider adding a /** global: define */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
9
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Dropdown = factory(global.jQuery, global.Popper, global.Util));
0 ignored issues
show
Best Practice introduced by
If you intend to check if the variable self is declared in the current environment, consider using typeof self === "undefined" instead. This is safe if the variable is not actually declared.
Loading history...
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
The variable globalThis seems to be never declared. If this is a global, consider adding a /** global: globalThis */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
10
}(this, (function ($, Popper, Util) { 'use strict';
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
14
  var $__default = /*#__PURE__*/_interopDefaultLegacy($);
15
  var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);
16
  var Util__default = /*#__PURE__*/_interopDefaultLegacy(Util);
17
18
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
0 ignored issues
show
Comprehensibility introduced by
It seems like you are trying to overwrite a function name here. _extends is already defined in line 18 as a function. While this will work, it can be very confusing.
Loading history...
Complexity introduced by
A for in loop automatically includes the property of any prototype object, consider checking the key using hasOwnProperty.

When iterating over the keys of an object, this includes not only the keys of the object, but also keys contained in the prototype of that object. It is generally a best practice to check for these keys specifically:

var someObject;
for (var key in someObject) {
    if ( ! someObject.hasOwnProperty(key)) {
        continue; // Skip keys from the prototype.
    }

    doSomethingWith(key);
}
Loading history...
19
20
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
21
22
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
23
  /**
24
   * ------------------------------------------------------------------------
25
   * Constants
26
   * ------------------------------------------------------------------------
27
   */
28
29
  var NAME = 'dropdown';
30
  var VERSION = '4.5.3';
31
  var DATA_KEY = 'bs.dropdown';
32
  var EVENT_KEY = "." + DATA_KEY;
33
  var DATA_API_KEY = '.data-api';
34
  var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];
35
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
36
37
  var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
38
39
  var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
40
41
  var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
42
43
  var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
44
45
  var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
46
47
  var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
48
  var EVENT_HIDE = "hide" + EVENT_KEY;
49
  var EVENT_HIDDEN = "hidden" + EVENT_KEY;
50
  var EVENT_SHOW = "show" + EVENT_KEY;
51
  var EVENT_SHOWN = "shown" + EVENT_KEY;
52
  var EVENT_CLICK = "click" + EVENT_KEY;
53
  var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
54
  var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY + DATA_API_KEY;
55
  var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY + DATA_API_KEY;
56
  var CLASS_NAME_DISABLED = 'disabled';
57
  var CLASS_NAME_SHOW = 'show';
58
  var CLASS_NAME_DROPUP = 'dropup';
59
  var CLASS_NAME_DROPRIGHT = 'dropright';
60
  var CLASS_NAME_DROPLEFT = 'dropleft';
61
  var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
62
  var CLASS_NAME_POSITION_STATIC = 'position-static';
63
  var SELECTOR_DATA_TOGGLE = '[data-toggle="dropdown"]';
64
  var SELECTOR_FORM_CHILD = '.dropdown form';
65
  var SELECTOR_MENU = '.dropdown-menu';
66
  var SELECTOR_NAVBAR_NAV = '.navbar-nav';
67
  var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
68
  var PLACEMENT_TOP = 'top-start';
69
  var PLACEMENT_TOPEND = 'top-end';
70
  var PLACEMENT_BOTTOM = 'bottom-start';
71
  var PLACEMENT_BOTTOMEND = 'bottom-end';
72
  var PLACEMENT_RIGHT = 'right-start';
73
  var PLACEMENT_LEFT = 'left-start';
74
  var Default = {
75
    offset: 0,
76
    flip: true,
77
    boundary: 'scrollParent',
78
    reference: 'toggle',
79
    display: 'dynamic',
80
    popperConfig: null
81
  };
82
  var DefaultType = {
83
    offset: '(number|string|function)',
84
    flip: 'boolean',
85
    boundary: '(string|element)',
86
    reference: '(string|element)',
87
    display: 'string',
88
    popperConfig: '(null|object)'
89
  };
90
  /**
91
   * ------------------------------------------------------------------------
92
   * Class Definition
93
   * ------------------------------------------------------------------------
94
   */
95
96
  var Dropdown = /*#__PURE__*/function () {
97
    function Dropdown(element, config) {
98
      this._element = element;
99
      this._popper = null;
100
      this._config = this._getConfig(config);
101
      this._menu = this._getMenuElement();
102
      this._inNavbar = this._detectNavbar();
103
104
      this._addEventListeners();
105
    } // Getters
106
107
108
    var _proto = Dropdown.prototype;
109
110
    // Public
111
    _proto.toggle = function toggle() {
112
      if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {
113
        return;
114
      }
115
116
      var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW);
117
118
      Dropdown._clearMenus();
119
120
      if (isActive) {
121
        return;
122
      }
123
124
      this.show(true);
125
    };
126
127
    _proto.show = function show(usePopper) {
128
      if (usePopper === void 0) {
0 ignored issues
show
Coding Style introduced by
Consider using undefined instead of void(0). It is equivalent and more straightforward to read.
Loading history...
129
        usePopper = false;
130
      }
131
132
      if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW)) {
133
        return;
134
      }
135
136
      var relatedTarget = {
137
        relatedTarget: this._element
138
      };
139
      var showEvent = $__default['default'].Event(EVENT_SHOW, relatedTarget);
140
141
      var parent = Dropdown._getParentFromElement(this._element);
142
143
      $__default['default'](parent).trigger(showEvent);
144
145
      if (showEvent.isDefaultPrevented()) {
146
        return;
147
      } // Disable totally Popper.js for Dropdown in Navbar
148
149
150
      if (!this._inNavbar && usePopper) {
151
        /**
152
         * Check for Popper dependency
153
         * Popper - https://popper.js.org
154
         */
155
        if (typeof Popper__default['default'] === 'undefined') {
156
          throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
157
        }
158
159
        var referenceElement = this._element;
160
161
        if (this._config.reference === 'parent') {
162
          referenceElement = parent;
163
        } else if (Util__default['default'].isElement(this._config.reference)) {
164
          referenceElement = this._config.reference; // Check if it's jQuery element
165
166
          if (typeof this._config.reference.jquery !== 'undefined') {
167
            referenceElement = this._config.reference[0];
168
          }
169
        } // If boundary is not `scrollParent`, then set position to `static`
170
        // to allow the menu to "escape" the scroll parent's boundaries
171
        // https://github.com/twbs/bootstrap/issues/24251
172
173
174
        if (this._config.boundary !== 'scrollParent') {
175
          $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC);
176
        }
177
178
        this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());
179
      } // If this is a touch-enabled device we add extra
180
      // empty mouseover listeners to the body's immediate children;
181
      // only needed because of broken event delegation on iOS
182
      // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
183
184
185
      if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
186
        $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);
187
      }
188
189
      this._element.focus();
190
191
      this._element.setAttribute('aria-expanded', true);
192
193
      $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW);
194
      $__default['default'](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_SHOWN, relatedTarget));
195
    };
196
197
    _proto.hide = function hide() {
198
      if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW)) {
199
        return;
200
      }
201
202
      var relatedTarget = {
203
        relatedTarget: this._element
204
      };
205
      var hideEvent = $__default['default'].Event(EVENT_HIDE, relatedTarget);
206
207
      var parent = Dropdown._getParentFromElement(this._element);
208
209
      $__default['default'](parent).trigger(hideEvent);
210
211
      if (hideEvent.isDefaultPrevented()) {
212
        return;
213
      }
214
215
      if (this._popper) {
216
        this._popper.destroy();
217
      }
218
219
      $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW);
220
      $__default['default'](parent).toggleClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_HIDDEN, relatedTarget));
221
    };
222
223
    _proto.dispose = function dispose() {
224
      $__default['default'].removeData(this._element, DATA_KEY);
225
      $__default['default'](this._element).off(EVENT_KEY);
226
      this._element = null;
227
      this._menu = null;
228
229
      if (this._popper !== null) {
230
        this._popper.destroy();
231
232
        this._popper = null;
233
      }
234
    };
235
236
    _proto.update = function update() {
237
      this._inNavbar = this._detectNavbar();
238
239
      if (this._popper !== null) {
240
        this._popper.scheduleUpdate();
241
      }
242
    } // Private
243
    ;
244
245
    _proto._addEventListeners = function _addEventListeners() {
246
      var _this = this;
247
248
      $__default['default'](this._element).on(EVENT_CLICK, function (event) {
249
        event.preventDefault();
250
        event.stopPropagation();
251
252
        _this.toggle();
253
      });
254
    };
255
256
    _proto._getConfig = function _getConfig(config) {
257
      config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config);
258
      Util__default['default'].typeCheckConfig(NAME, config, this.constructor.DefaultType);
259
      return config;
260
    };
261
262
    _proto._getMenuElement = function _getMenuElement() {
263
      if (!this._menu) {
264
        var parent = Dropdown._getParentFromElement(this._element);
265
266
        if (parent) {
267
          this._menu = parent.querySelector(SELECTOR_MENU);
268
        }
269
      }
270
271
      return this._menu;
272
    };
273
274
    _proto._getPlacement = function _getPlacement() {
275
      var $parentDropdown = $__default['default'](this._element.parentNode);
276
      var placement = PLACEMENT_BOTTOM; // Handle dropup
277
278
      if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
279
        placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
280
      } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
281
        placement = PLACEMENT_RIGHT;
282
      } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
283
        placement = PLACEMENT_LEFT;
284
      } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
285
        placement = PLACEMENT_BOTTOMEND;
286
      }
287
288
      return placement;
289
    };
290
291
    _proto._detectNavbar = function _detectNavbar() {
292
      return $__default['default'](this._element).closest('.navbar').length > 0;
293
    };
294
295
    _proto._getOffset = function _getOffset() {
296
      var _this2 = this;
297
298
      var offset = {};
299
300
      if (typeof this._config.offset === 'function') {
301
        offset.fn = function (data) {
302
          data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
303
          return data;
304
        };
305
      } else {
306
        offset.offset = this._config.offset;
307
      }
308
309
      return offset;
310
    };
311
312
    _proto._getPopperConfig = function _getPopperConfig() {
313
      var popperConfig = {
314
        placement: this._getPlacement(),
315
        modifiers: {
316
          offset: this._getOffset(),
317
          flip: {
318
            enabled: this._config.flip
319
          },
320
          preventOverflow: {
321
            boundariesElement: this._config.boundary
322
          }
323
        }
324
      }; // Disable Popper.js if we have a static display
325
326
      if (this._config.display === 'static') {
327
        popperConfig.modifiers.applyStyle = {
328
          enabled: false
329
        };
330
      }
331
332
      return _extends({}, popperConfig, this._config.popperConfig);
333
    } // Static
334
    ;
335
336 View Code Duplication
    Dropdown._jQueryInterface = function _jQueryInterface(config) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
337
      return this.each(function () {
338
        var data = $__default['default'](this).data(DATA_KEY);
339
340
        var _config = typeof config === 'object' ? config : null;
341
342
        if (!data) {
343
          data = new Dropdown(this, _config);
344
          $__default['default'](this).data(DATA_KEY, data);
345
        }
346
347
        if (typeof config === 'string') {
348
          if (typeof data[config] === 'undefined') {
349
            throw new TypeError("No method named \"" + config + "\"");
350
          }
351
352
          data[config]();
353
        }
354
      });
355
    };
356
357
    Dropdown._clearMenus = function _clearMenus(event) {
358
      if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
359
        return;
360
      }
361
362
      var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
363
364
      for (var i = 0, len = toggles.length; i < len; i++) {
365
        var parent = Dropdown._getParentFromElement(toggles[i]);
366
367
        var context = $__default['default'](toggles[i]).data(DATA_KEY);
368
        var relatedTarget = {
369
          relatedTarget: toggles[i]
370
        };
371
372
        if (event && event.type === 'click') {
373
          relatedTarget.clickEvent = event;
374
        }
375
376
        if (!context) {
377
          continue;
378
        }
379
380
        var dropdownMenu = context._menu;
381
382
        if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW)) {
383
          continue;
384
        }
385
386
        if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) {
387
          continue;
388
        }
389
390
        var hideEvent = $__default['default'].Event(EVENT_HIDE, relatedTarget);
391
        $__default['default'](parent).trigger(hideEvent);
392
393
        if (hideEvent.isDefaultPrevented()) {
394
          continue;
395
        } // If this is a touch-enabled device we remove the extra
396
        // empty mouseover listeners we added for iOS support
397
398
399
        if ('ontouchstart' in document.documentElement) {
400
          $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);
401
        }
402
403
        toggles[i].setAttribute('aria-expanded', 'false');
404
405
        if (context._popper) {
406
          context._popper.destroy();
407
        }
408
409
        $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW);
410
        $__default['default'](parent).removeClass(CLASS_NAME_SHOW).trigger($__default['default'].Event(EVENT_HIDDEN, relatedTarget));
411
      }
412
    };
413
414
    Dropdown._getParentFromElement = function _getParentFromElement(element) {
415
      var parent;
416
      var selector = Util__default['default'].getSelectorFromElement(element);
417
418
      if (selector) {
419
        parent = document.querySelector(selector);
420
      }
421
422
      return parent || element.parentNode;
423
    } // eslint-disable-next-line complexity
424
    ;
425
426
    Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
427
      // If not input/textarea:
428
      //  - And not a key in REGEXP_KEYDOWN => not a dropdown command
429
      // If input/textarea:
430
      //  - If space key => not a dropdown command
431
      //  - If key is other than escape
432
      //    - If key is not up or down => not a dropdown command
433
      //    - If trigger inside the menu => not a dropdown command
434
      if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
435
        return;
436
      }
437
438
      if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) {
439
        return;
440
      }
441
442
      var parent = Dropdown._getParentFromElement(this);
443
444
      var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW);
445
446
      if (!isActive && event.which === ESCAPE_KEYCODE) {
447
        return;
448
      }
449
450
      event.preventDefault();
451
      event.stopPropagation();
452
453
      if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {
454
        if (event.which === ESCAPE_KEYCODE) {
455
          $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE)).trigger('focus');
456
        }
457
458
        $__default['default'](this).trigger('click');
459
        return;
460
      }
461
462
      var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
463
        return $__default['default'](item).is(':visible');
464
      });
465
466
      if (items.length === 0) {
467
        return;
468
      }
469
470
      var index = items.indexOf(event.target);
471
472
      if (event.which === ARROW_UP_KEYCODE && index > 0) {
473
        // Up
474
        index--;
475
      }
476
477
      if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
478
        // Down
479
        index++;
480
      }
481
482
      if (index < 0) {
483
        index = 0;
484
      }
485
486
      items[index].focus();
487
    };
488
489
    _createClass(Dropdown, null, [{
490
      key: "VERSION",
491
      get: function get() {
492
        return VERSION;
493
      }
494
    }, {
495
      key: "Default",
496
      get: function get() {
497
        return Default;
498
      }
499
    }, {
500
      key: "DefaultType",
501
      get: function get() {
502
        return DefaultType;
503
      }
504
    }]);
505
506
    return Dropdown;
507
  }();
508
  /**
509
   * ------------------------------------------------------------------------
510
   * Data Api implementation
511
   * ------------------------------------------------------------------------
512
   */
513
514
515
  $__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {
516
    event.preventDefault();
517
    event.stopPropagation();
518
519
    Dropdown._jQueryInterface.call($__default['default'](this), 'toggle');
520
  }).on(EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, function (e) {
521
    e.stopPropagation();
522
  });
523
  /**
524
   * ------------------------------------------------------------------------
525
   * jQuery
526
   * ------------------------------------------------------------------------
527
   */
528
529
  $__default['default'].fn[NAME] = Dropdown._jQueryInterface;
530
  $__default['default'].fn[NAME].Constructor = Dropdown;
531
532
  $__default['default'].fn[NAME].noConflict = function () {
533
    $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;
534
    return Dropdown._jQueryInterface;
535
  };
536
537
  return Dropdown;
538
539
})));
540
//# sourceMappingURL=dropdown.js.map
541